You use the factory method pattern when an application needs to create objects whose type depend on the implementation of subclasses.
您可以在应用程序需要创建其类型依赖于子类的实现的对象时,使用工厂方法模式。
The factory method pattern, as its name implies, defines the implementation of a method used to churn out objects.
而工厂方法模式,顾名思义,定义的是一个用来大量产出对象的方法的实现。
To create an instance of the Factory Method Pattern, perform the same steps as for the Singleton Pattern.
要创建Factory方法模式的实例,执行同Singleton模式相同的步骤。
应用推荐